//
//  GameCntrolMenu.m
//  G03
//
//  Created by zhu yi on 9/1/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

#import "GameCntrolMenu.h"
#import "GridSizeSelect.h"
#import "MainMenu.h"

@implementation GameCntrolMenu

- (id) init
{
	self = [super init];
	if (self)
	{

		// Add Control Items
		
        //[CCMenuItemFont setFontName:@"font01.fnt"];
        CCMenuItem *Home = [CCMenuItemFont itemFromString:@"Home" target:self selector:@selector(OnHome:)];
		CCMenuItem *Reset = [CCMenuItemFont itemFromString:@"Reset" target:self selector:@selector(OnReset:)];	
        CCMenuItem *Back = [CCMenuItemFont itemFromString:@"Back" target:self selector:@selector(OnBack:)];
		Home.scale = 1.3;
        Reset.scale = 1.3;
        Back.scale = 1.3;
        
		CCMenu *mn = [CCMenu menuWithItems: Home, Reset, Back, nil];
		mn.position = ccp(230,50);
        [mn alignItemsHorizontallyWithPadding:100.0f];		//systemMenu.anchorPoint = ccp(0.5, 0.5);
		//systemMenu.position = ccp(100,100);
		
		[self addChild:mn z:1 tag:2];
	}
	
	return self;
}

- (void) OnHome:(id) sender
{
	
	[[CCDirector sharedDirector] replaceScene: [CCTransitionSlideInL transitionWithDuration:1.2f scene:
        [MainMenu  node]]];
	
}

- (void) OnReset:(id) sender
{
	
	
}

- (void) OnBack:(id) sender
{
	
	[[CCDirector sharedDirector] replaceScene: [CCTransitionSlideInL transitionWithDuration:1.2f scene:[GridSizeSelect node]]];
	
}


- (void) dealloc
{
	[super dealloc];
}


@end
